window.addEventListener('load', function () {
    var ul = document.querySelector('.hot').querySelector('ul');
    var li = ul.querySelector('li');
    for (var i = 0; i < 3; i++) {
        var new_li = li.cloneNode(true);
        ul.appendChild(new_li);
    }
    myajax({
        method: 'GET',
        url: 'http://localhost:3000/useing/public',
        success: function (res) {
            var lis = ul.querySelectorAll('li');
            for (var i = 0; i < lis.length; i++) {
                lis[i].querySelector(".pic").querySelector('img').src = res[i].img;
                lis[i].querySelector(".txt").querySelector('h4').innerHTML = res[i].text;
                lis[i].querySelector('.txt').querySelector('.totalnum').innerHTML = res[i].totalnum;
                lis[i].querySelector('.txt').querySelector('.num').innerHTML = res[i].num;
                lis[i].querySelector('.txt').querySelector('.count').querySelector('span').innerHTML = res[i].apply;
                lis[i].querySelector('.txt').querySelector('.time').innerHTML = res[i].endTime;
            }
        }
    })
    myajax({
        method: 'GET',
        url: 'http://localhost:3000/guid/new',
        success: function (res) {
            var htmlStr = template('tpl_report', { datas: res });
            var ul = document.querySelector('.report').querySelector('.cont').querySelector('ul');
            ul.innerHTML = htmlStr;
        }
    })
})